package mybatis.test;

import mybatis.MyBatisUtils;
import mybatis.mapper.StudentMapper;
import mybatis.pojo.Student;
import org.apache.ibatis.session.SqlSession;

public class Part11_Insert_Student {
    public static void main(String[] args) {
        SqlSession sqlSession = MyBatisUtils.getSession();
        StudentMapper studentMapper = sqlSession.getMapper(StudentMapper.class);

        Student Student4Insert = new Student("ikun", 20);

        int nVa = studentMapper.addStudent(Student4Insert);
        System.out.println(nVa);
        System.out.println(Student4Insert.getId());


        sqlSession.commit();
        sqlSession.close();
    }
}
